package org.nifi.processors.config;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Duration;

@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class DataAccessProperties {

    private boolean enabled = true;

    /**
     * 应用ID
     */
    private String appId;

    /**
     * 公钥
     */
    private String publicKey;

    /**
     * 地址
     */
    private String address;

    /**
     * token地址
     */
    private String tokenUrl = "/zjdata/api/zjdata/v1/token";

    /**
     * 超时配置
     */
    private Duration timeout = Duration.ofSeconds(10);

    public String getTokenFullUrl() {
        return address + tokenUrl;
    }
}
